package com.ruoyi.hospital.service.shop.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.hospital.mapper.shop.ShopProductTagsMapper;
import com.ruoyi.hospital.domain.shop.ShopProductTags;
import com.ruoyi.hospital.service.shop.IShopProductTagsService;

/**
 * 商品标签Service业务层处理
 * 
 * @author wendao
 * @date 2024-08-19
 */
@Service
public class ShopProductTagsServiceImpl implements IShopProductTagsService 
{
    @Autowired
    private ShopProductTagsMapper shopProductTagsMapper;

    /**
     * 查询商品标签
     * 
     * @param id 商品标签主键
     * @return 商品标签
     */
    @Override
    public ShopProductTags selectShopProductTagsById(Integer id)
    {
        return shopProductTagsMapper.selectShopProductTagsById(id);
    }

    /**
     * 查询商品标签列表
     * 
     * @param shopProductTags 商品标签
     * @return 商品标签
     */
    @Override
    public List<ShopProductTags> selectShopProductTagsList(ShopProductTags shopProductTags)
    {
        return shopProductTagsMapper.selectShopProductTagsList(shopProductTags);
    }

    /**
     * 新增商品标签
     * 
     * @param shopProductTags 商品标签
     * @return 结果
     */
    @Override
    public int insertShopProductTags(ShopProductTags shopProductTags)
    {
        shopProductTags.setCreateTime(DateUtils.getNowTimeSecond());
        return shopProductTagsMapper.insertShopProductTags(shopProductTags);
    }

    /**
     * 修改商品标签
     * 
     * @param shopProductTags 商品标签
     * @return 结果
     */
    @Override
    public int updateShopProductTags(ShopProductTags shopProductTags)
    {
        shopProductTags.setUpdateTime(DateUtils.getNowTimeSecond());
        return shopProductTagsMapper.updateShopProductTags(shopProductTags);
    }

    /**
     * 批量删除商品标签
     * 
     * @param ids 需要删除的商品标签主键
     * @return 结果
     */
    @Override
    public int deleteShopProductTagsByIds(Integer[] ids)
    {
        return shopProductTagsMapper.deleteShopProductTagsByIds(ids);
    }

    /**
     * 删除商品标签信息
     * 
     * @param id 商品标签主键
     * @return 结果
     */
    @Override
    public int deleteShopProductTagsById(Integer id)
    {
        return shopProductTagsMapper.deleteShopProductTagsById(id);
    }
}
